<?php

class IndexController extends Controller{
	
	private $_db;
	public function __init(){
		$this->_db=K('Applyfordesign');
	}
	
    public function index(){
		if(IS_POST){
			if($this->_db->apply()){
				$this->success('提交成功');
			}else{
				$this->error('提交失败，'.$this->_db->error);
			}
		}else{
			$this->display();
		}
        
    }
	
	public function code()
    {
        C(array(
                "CODE_BG_COLOR" => "#ffffff", "CODE_LEN" => 4,
                "CODE_FONT_SIZE" => 20, "CODE_WIDTH" => 120,
                "CODE_HEIGHT" => 35,
            )
        );
        $code = new Code();
        $code->show();
        exit;
    }
}
